package com.Nuyoah.demo01.service;

import com.Nuyoah.demo01.DTO.RoleBindDTO;
import com.Nuyoah.demo01.DTO.UserDTO;
import com.Nuyoah.demo01.DTO.UserLoginDTO;
import com.Nuyoah.demo01.DTO.UserPageQry;
import com.Nuyoah.demo01.VO.UserVO;
import com.Nuyoah.demo01.common.JsonResult;
import com.Nuyoah.demo01.entity.User;
import com.baomidou.mybatisplus.core.metadata.IPage;


import java.util.List;
import java.util.Map;

public interface UserService {

    User getUserByName(String username);

//    JsonResult insertUser(User user);

     JsonResult insertUser(Map<String, Object> requestBody);

//    List<UserDTO> selectAllUsers();

    JsonResult selectAllUsers();

    List<UserDTO> selectPageUsers(UserPageQry qry);

    IPage<UserDTO> selectPage(UserPageQry qry);

    String generateCaptcha();

    JsonResult login(UserLoginDTO userLoginDTO);

//    Integer updateUser(User user);
    JsonResult updateUser(Integer id, String username, String password, String email);

//    Integer deleteUser(Integer user_id);
    JsonResult deleteUser(Integer user_id);

    JsonResult banUser(Integer user_id);

    JsonResult unbanUser(Integer user_id);

    User getUserByEmail(String email);

    boolean validateCaptcha(String userInput, String sessionId);

    UserVO getUserById(Integer userId);

//    JsonResult isAdmin(Integer id);
//
    JsonResult setAdmin(Integer id);

    JsonResult<String> bindRole(RoleBindDTO roleBindDTO);

    JsonResult<String> assignRole(Integer roleId, Integer permId);
}